package com.example.lawyermanager.dongao.mapper;

import com.example.lawyermanager.dongao.entity.Lawyer;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 律师档案操作：创建、查询、修改、删除
 * @author zhangjing
 * @version 1.0
 */
@Repository
@Mapper
public interface LawyerMapper {
    /**
     * 添加律师（创建律师档案)
     * @param lawyer 包含律师信息的对象
     * @return 创建成功返回1，否则返回0
     */
    public int insertLawyer(Lawyer lawyer);
    /**
     * 删除律师档案
     * @param lawyerid 律师编号
     * @return 删除成功返回1，否则返回0
     */
    public int deleteLawyer(int lawyerid);
    /**
     * 修改律师档案
     * @param lawyer 律师对象，包含律师的全部信息
     * @return 修改成功返回1，否则返回0
     */
    public int updateLawyer(Lawyer lawyer);
    /**
     * 按编号查询律师
     * @param lawyerid 律师编号
     * @return 查询得到的律师对象
     */
    public Lawyer selectLawyerById(int lawyerid);
    /**
     * 查询所有律师
     * @return 律师集合
     */
    public List<Lawyer> selectlawyer();

}
